<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // 编写一个参数JavaScript函数parseQueryString，它的用途是把url参数解析为一个对象
    var url = "http://www.taobao.com/index.php?key0=0&key1=1&key2=2.............";
    var obj = parseQueryString(url);

    function parseQueryString(argu) {
        var str = argu.split('?')[1];
        var result = {};
        var temp = str.split('&');
        for (var i = 0; i < temp.length; i++) {
            var temp2 = temp[i].split('=');
            result[temp2[0]] = temp2[1];
        }
        return result;
    }
</script>

</html>